#!/usr/bin/python
# -*- coding:utf-8 -*-

'''
Created on 11 juin 2014

@author: Alexandre Neuville
'''

from argparse import ArgumentParser

from controller import ConsoleApp
from persistence import JSONConfig


if __name__ == '__main__':
    parser = ArgumentParser(prog="console", usage="%(prog)s [options]")
    parser.add_argument("-c", "--config", action="store", required=True, dest="filename", metavar="FILE",
            help="Fichier de configuration")

    args = parser.parse_args()
    with JSONConfig(args.filename) as config:
        app = ConsoleApp(config)
        app.executeApp()
